<!DOCTYPE html>
<html lang="en">
<head>
	{% block head %}
		{% block scripts %}
			<meta charset="UTF-8">
			<link rel="stylesheet" href="{{ settings.assets_url }}css/bootstrap.css">
			<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
			<script src="{{ settings.assets_url }}javascript/bootstrap.min.js"></script>
			<script src="{{ settings.assets_url }}javascript/admin.min.js"></script>
			<script src="{{ settings.assets_url }}javascript/jquery.cookie.js"></script>
			<script src="{{ settings.assets_url }}javascript/jquery.debounce.js"></script>
			<script src="{{ settings.assets_url }}javascript/jquery.redirect.min.js"></script>
			<script src="{{ settings.assets_url }}javascript/socket.io.min.js"></script>
		{% endblock %}
		<title>{{ settings.company_name }} - {% block title %}{% endblock %}</title>
	{% endblock %}
</head>
<body>
	<div class="container">
		<div class="pull-right" style="margin-top: -26px;">
			<a href="{{ settings.master_url }}ajax/set_language.php?language=de" class="language">Deutsch</a>
			<a href="{{ settings.master_url }}ajax/set_language.php?language=en" class="language">English</a>
			<a href="{{ settings.master_url }}ajax/set_language.php?language=es" class="language">Espa&ntilde;ol</a>
			<a href="{{ settings.master_url }}ajax/set_language.php?language=fr" class="language">Fran&ccedil;ais</a>
			<a href="{{ settings.master_url }}ajax/set_language.php?language=pt" class="language">Portugu&ecirc;s</a>
			<a href="{{ settings.master_url }}ajax/set_language.php?language=ru" class="language">&#1088;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;</a>
			<a href="{{ settings.master_url }}ajax/set_language.php?language=se" class="language">Svenska</a>
			<a href="{{ settings.master_url }}ajax/set_language.php?language=zh" class="language">&#20013;&#22269;&#30340;的</a>
		</div>
		<div class="navbar navbar-default">
			<div class="navbar-header">
				<a class="navbar-brand" href="#">{{ settings.company_name }}</a>
			</div>
			{% block servername %}{% endblock %}
			<div class="navbar-collapse navbar-responsive-collapse collapse" style="height: 1px;">
				<ul class="nav navbar-nav navbar-right">
					{% if admin %}<li><a href="{{ settings.master_url }}admin/index.php"><i class="fa fa-cogs"></i></a></li>{% endif %}
					<li><a href="{{ settings.master_url }}logout.php"><i class="fa fa-power-off"></i></a></li>
				</ul>
			</div>
		</div>
		<div class="row">
			<div class="col-3">
				{% block sidebar %}{% endblock %}
			</div>
			{% block content %}{% endblock %}
		</div>
		<div class="footer">
			<div class="row">
				<div class="col-8 ">
					<p>{{ lang.footer_license|raw }}<br />{{ lang.footer_version|format(fversion)|raw }}</p>
				</div>
				<div class="col-4">
					<p class="pull-right">{{ lang.footer_generated|format(footer.seconds) }}</p>
				</div>
			</div>
			<script type="text/javascript">
			$(document).ready(function(){
				if($.urlParam('tab') != null){$('#config_tabs a[href="#'+$.urlParam('tab')+'"]').tab('show');}
				function updateServerStatus() {
					$(".dynUpdate").each(function(index, data){
						$("#applyUpdate").removeClass("fa-circle").css('color', '#fff');
						$("#applyUpdate").addClass("fa-circle-o-notch fa-spinner fa-spin");
						var connection = $(this).attr("id");
						var element = $(this);
						$.ajax({
							type: "POST",
							url: "{{ settings.master_url }}ajax/get_status.php",
							data: { server: connection },
							success: function(data) {
									element.find("#applyUpdate").removeClass("fa-circle-o-notch fa-spinner fa-spin");
									element.find("#applyUpdate").addClass("fa-circle").css({"color": data});
							}
						});
					});
				}
				updateServerStatus();
				setInterval(updateServerStatus, 15000);
			});
			</script>
		</div>
	</div>
</body>
</html>
